#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/12/27 18:51
# @Author: 周健
# @Email: 907614893@qq.com
# @File：jianzi_page.py

from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class JiaoZiPage(BasePage):
    evaluate_locator = (By.XPATH,'//android.widget.TextView[@resource-id=\"com.gfeng.daydaycook:id/tv_comment\"]')
    input_locator = (By.XPATH,'//android.widget.EditText[@resource-id=\"com.gfeng.daydaycook:id/et_comment\"]')
    send_locator = (By.XPATH,'//android.widget.TextView[@resource-id=\"com.gfeng.daydaycook:id/tv_commit\"]')

    # 点击评论
    def click_evaluate(self):
        self.driver.find_element(*self.evaluate_locator).click()
    # 输入评论信息
    def input_evaluate(self,evaluate):
        self.driver.find_element(*self.input_locator).send_keys(evaluate)
    # 点击发送
    def send_evaluate(self):
        self.driver.find_element(*self.send_locator).click()

    def get_evaluate_activity(self):
        return self.driver.current_activity
